﻿using AutoTaskSchedule.Core.Business;
using AutoTaskSchedule.Core.Models;

namespace AutoTaskSchedule.Core.Extensions
{
    public static class TaskExtension
    {
        public static TaskFactory GetFactory(this Task task)
        {
            if (task.Interval.HasValue)
                return new IntervalTaskFactory(task);
            return new TimingTaskFactory(task);
        }
    }
}